/*
 * HttpCodes.cpp
 *
 */

#include "HttpCodes.h"

HttpCodes::HttpCodes() {
}

HttpCodes::~HttpCodes() {
}

const std::string HttpCodes::getMessage(int code) {
	std::string value;
	switch (code) {
		case OK: value = MSG200; break;
		case CREATED: value = MSG201; break;
		case ACCEPTED: value = MSG202; break;
		case NO_CONTENT: value = MSG204; break;
		case MOVED_PERMANENTLY: value = MSG301; break;
		case MOVED_TEMPORARILY: value = MSG302; break;
		case NOT_MODIFIED: value = MSG304; break;
		case BAD_REQUEST: value = MSG400; break;
		case UNAUTHORIZED: value = MSG401; break;
		case FORBIDDEN: value = MSG403; break;
		case NOT_FOUND: value = MSG404; break;
		case INTERNAL_SERVER_ERROR: value = MSG500; break;
		case NOT_IMPLEMENTED: value = MSG501; break;
		case BAD_GATEWAY: value = MSG502; break;
		case SERVICE_UNAVAILABLE: value = MSG503; break;
		default: value = MSGBAD; break;
	}
	return value;
}

const std::string HttpCodes::MSG200 = "OK";
const std::string HttpCodes::MSG201 = "Created";
const std::string HttpCodes::MSG202 = "Accepted";
const std::string HttpCodes::MSG204 = "No Content";
const std::string HttpCodes::MSG301 = "Moved Permanently";
const std::string HttpCodes::MSG302 = "Moved Temporarily";
const std::string HttpCodes::MSG304 = "Not Modified";
const std::string HttpCodes::MSG400 = "Bad Request";
const std::string HttpCodes::MSG401 = "Unauthorized";
const std::string HttpCodes::MSG403 = "Forbidden";
const std::string HttpCodes::MSG404 = "Not Found";
const std::string HttpCodes::MSG500 = "Internal Server Error";
const std::string HttpCodes::MSG501 = "Not Implemented";
const std::string HttpCodes::MSG502 = "Bad Gateway";
const std::string HttpCodes::MSG503 = "Service Unavailable";
const std::string HttpCodes::MSGBAD = "Unknown code";
